import axios from "axios";
import YYRequest from "../index";

// 自动获取IP
export function autoGetIP() {
  const instance = axios.create({
    baseURL:
      "https://restapi.amap.com/v3/ip?key=251f3b47936bf2e44213d0b3a4172628",
    timeout: 5000,
  });
  return instance();
}

export function getIPValue(location) {
  const instance = axios.create({
    baseURL: "https://geoapi.qweather.com/v2/city/lookup",
    timeout: 5000,
    params: {
      location,
      key: "3c857080d7264b01bc62620947823430",
    },
  });
  return instance();
}
